package utils;

/**
 * A library of function used to design the application
 * @author chocoseb
 */
public abstract class ChocoDesign {

    /**
     * Set the Look and Feel of the application to nimbus
     */
    public static void setLookToNimbus() {
        javax.swing.UIManager.LookAndFeelInfo laListLook[] = javax.swing.UIManager.getInstalledLookAndFeels();
        boolean lbTrouve = false;
        int liIndex = 0;

        for (int liI = 0; liI < laListLook.length; liI++) {
            if (laListLook[liI].getClassName().toLowerCase().contains("nimbus")) {
                lbTrouve = true;
                liIndex = liI;
            }
        }

        try {
            if (lbTrouve) {
                javax.swing.UIManager.setLookAndFeel(laListLook[liIndex].getClassName());
            } else {
                javax.swing.UIManager.setLookAndFeel(
                        javax.swing.UIManager.getCrossPlatformLookAndFeelClassName());
            }
        } catch (Exception e) {
        }
    }
}
